package mapper;

import com.sqsf.javabean.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    List<User> selectAll();
    List<User> selectByUsernameAndPassword(@Param("username") String username,@Param("password") String password);

    @Select("select * from user where uid=#{uid}")
    List<User> selectByUid(int uid);
    @Update("update user set password=#{password} where uid=#{uid}")
    int updatePasswordByUid(@Param("uid") int uid,@Param("password") String password);
    @Delete("delete from user where uid=#{uid}")
    int deleteByUid(int uid);
    @Insert("insert into user (username,password,phone) values(#{username},#{password},#{phone})")
    int insertUser(User user);
}
